package com.blog.controller;

import com.blog.Utils.Result;
import com.blog.annotion.LoginAnnotatio;
import com.blog.base.ThreadLocalUserId;
import com.blog.bean.dto.MessageDTO;
import com.blog.bean.vo.MessageListVO;
import com.blog.webSocket.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 任浩
 * @version 1.0
 */


@RestController
@RequestMapping("/chatList")
public class ChatListController {

    @Autowired
    private ChatService chatService;
    @GetMapping
    @LoginAnnotatio
    public Result ChatList(MessageDTO messageDTO) {
        String s = ThreadLocalUserId.get();
        Result<MessageListVO> fromUserChatList = chatService.getFromUserChatList(s, messageDTO);

        return Result.success(fromUserChatList);
    }

}
